/*
 * Attack.h
 *
 *  Created on: 06/05/2011
 *      Author: DessaVida
 */

#ifndef ATTACK_H_
#define ATTACK_H_

#include "math/Rectangle.h"
#include "Position.h"
#include "Component.h"
#include "util/Timer.h"

#include <vector>
#include <algorithm>
using namespace std;


using std::vector;

class Attack : public Component{
	Rectangle attackArea;
	Point2D attackCenter;
    int attackSpeed;
    int baseAttackSpeed;
    int damage;
    int baseDamage;

    bool active;
public:
    vector<int> *hittedsObjs;
    Timer *timer;
    Timer *reloadTimer;

    int getBaseDamage() const;
    void setBaseDamage(int baseDamage);

    Attack(int id, int baseAttackSpeed, int damage);
    virtual ~Attack();

    bool onAttack(int id);
    Rectangle getArea();
    bool getActive() const;
    void setActive(bool active);
    Rectangle getAttackArea() const;
    Point2D getAttackCenter() const;
    int getAttackSpeed() const;
    int getBaseAttackSpeed() const;
    void setAttackArea(Rectangle attackArea);
    void setAttackCenter(Point2D attackCenter);
    void setAttackSpeed(int attackSpeed);
    void setBaseAttackSpeed(int baseAttackSpeed);
    int getDamage() const;
    void setDamage(int damage);
};

#endif /* ATTACK_H_ */
